//
//  SendStatusService.m
//  SinaWebo
//
//  Created by wwj on 16/1/15.
//  Copyright © 2016年 亦心. All rights reserved.
//

#import "SendStatusService.h"
#import "HttpUtil.h"
#import <MJExtension.h>

@implementation SendStatusService
+(void)sentStatusWith:(SendStatusRequest *)request success:(void (^)(SendStatusResponse *response))success error:(void (^)(NSError *error))error{
    [HttpUtil postWithURL:getSendStatusURL params:request.mj_keyValues success:^(id responseObject) {
        if (success) {
            SendStatusResponse *data = [SendStatusResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *failure) {
        if (error) {
            error(failure);
        }
    } ];
}

+(void)sentStatusImageWith:(SendStatusRequest *)request fromDataArray:(NSMutableArray *)fromDataArray success:(void (^)(SendStatusResponse *))success error:(void (^)(NSError *))error{
    [HttpUtil postWithURL:getSendImgStatusURL params:request.mj_keyValues formDataArray:fromDataArray success:^(id responseObject) {
        if (success) {
            SendStatusResponse *data = [SendStatusResponse mj_objectWithKeyValues:responseObject];
            success(data);
        }
    } failure:^(NSError *failure) {
        if (error) {
            error(failure);
        }
    } ];
}
@end
